package jetty;

import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.DefaultHandler;
import org.mortbay.jetty.handler.HandlerCollection;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;

public class Main {

	public static void main(String[] args) throws Exception {
 
		//WebAppContext wac = new WebAppContext("E:/workspaces/flex/webDS/target/web-1.0/WEB-INF/web.xml", "/wac");
		Server server = new Server();

		Connector connector = new SelectChannelConnector();
		connector.setPort(8080);
		server.setConnectors(new Connector[]{connector});

		WebAppContext webappcontext = new WebAppContext();
		webappcontext.setContextPath("/");
		webappcontext.setWar("D:\\workspaces\\tech\\flatsmap-web\\target\\flatsmap-web-1.0-SNAPSHOT");

		HandlerCollection handlers= new HandlerCollection();
		handlers.setHandlers(new Handler[]{webappcontext, new DefaultHandler()});

		server.setHandler(handlers);

		server.start();
		server.join();

	}
}
